﻿Imports Licenta3.Common.Framework
Imports Licenta3.Common.Classes
Imports Autodesk.AutoCAD.EditorInput
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.ApplicationServices
Imports Licenta3.Commanding
Imports System.Collections.ObjectModel

<Serializable()>
Public Class Imobil
    Inherits ObjectBase
    Private _Adresa As New Adresa
    Public Property Adresa As Adresa
        Get
            Return _Adresa
        End Get
        Set(value As Adresa)
            _Adresa = value
            OnPropertyChanged("Adresa")
        End Set
    End Property
    Private _UAT As New UAT
    Public Property UAT As UAT
        Get
            Return _UAT
        End Get
        Set(value As UAT)
            _UAT = value
            OnPropertyChanged("UAT")
        End Set
    End Property
    Private _NrCF As String
    Public Property NrCF As String
        Get
            Return _NrCF
        End Get
        Set(value As String)
            _NrCF = value
            OnPropertyChanged("NrCF")
        End Set
    End Property
    Private _NrCadastral As String = ""
    Public Property NrCadastral As String
        Get
            Return _NrCadastral
        End Get
        Set(value As String)
            _NrCadastral = value
            OnPropertyChanged("NrCadastral")
        End Set
    End Property
    <NonSerialized> Private _Polyline As New PolylineObject
    <System.Xml.Serialization.XmlIgnore> Public Property Polyline As PolylineObject
        Get
            Return _Polyline
        End Get
        Set(value As PolylineObject)
            _Polyline = value
            OnPropertyChanged("Geometry")
        End Set
    End Property
    Private _Parcele As New ObservableCollection(Of Parcela)
    Public Property Parcele As ObservableCollection(Of Parcela)
        Get
            Return _Parcele
        End Get
        Set(value As ObservableCollection(Of Parcela))
            _Parcele = value
            OnPropertyChanged("Parcele")
        End Set
    End Property
    Private _Constructii As New ObservableCollection(Of Constructie)
    Public Property Constructii As ObservableCollection(Of Constructie)
        Get
            Return _Constructii
        End Get
        Set(value As ObservableCollection(Of Constructie))
            _Constructii = value
            OnPropertyChanged("Constructii")
        End Set
    End Property
    Private _Vecini As New ObservableCollection(Of PersoanaClass)
    Public Property Vecini As ObservableCollection(Of PersoanaClass)
        Get
            Return _Vecini
        End Get
        Set(value As ObservableCollection(Of PersoanaClass))
            _Vecini = value
            OnPropertyChanged("Vecini")
        End Set
    End Property
    Private _SuprafataDinAct As String
    Public Property SuprafataDinAct As String
        Get
            Return _SuprafataDinAct
        End Get
        Set(value As String)
            _SuprafataDinAct = value
            OnPropertyChanged("SuprafataDinAct")
        End Set
    End Property
    Private _Descriere As String = ""
    Public Property Descriere As String
        Get
            Return _Descriere
        End Get
        Set(value As String)
            _Descriere = value
            OnPropertyChanged("Descriere")
        End Set
    End Property
    Sub UpdateVecini()
        Vecini.Clear()
        If Me.Polyline IsNot Nothing Then
            For i = 0 To Me.Polyline.Geometry.NumberOfVertices - 1
                Vecini.Add(New PersoanaClass)
            Next
        End If

        OnPropertyChanged("Vecini")
    End Sub

    

End Class
